<?php

/**
 * sitetree filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasesitetreeFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ClassName'         => new sfWidgetFormChoice(array('choices' => array('' => '', 'SiteTree' => 'SiteTree', 'Page' => 'Page', 'ErrorPage' => 'ErrorPage', 'RedirectorPage' => 'RedirectorPage', 'VirtualPage' => 'VirtualPage'))),
      'Created'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'LastEdited'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'URLSegment'        => new sfWidgetFormFilterInput(),
      'Title'             => new sfWidgetFormFilterInput(),
      'MenuTitle'         => new sfWidgetFormFilterInput(),
      'Content'           => new sfWidgetFormFilterInput(),
      'MetaTitle'         => new sfWidgetFormFilterInput(),
      'MetaDescription'   => new sfWidgetFormFilterInput(),
      'MetaKeywords'      => new sfWidgetFormFilterInput(),
      'ExtraMeta'         => new sfWidgetFormFilterInput(),
      'ShowInMenus'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ShowInSearch'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'HomepageForDomain' => new sfWidgetFormFilterInput(),
      'ProvideComments'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'Sort'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'HasBrokenFile'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'HasBrokenLink'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'Status'            => new sfWidgetFormFilterInput(),
      'ReportClass'       => new sfWidgetFormFilterInput(),
      'CanViewType'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'Anyone' => 'Anyone', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers', 'Inherit' => 'Inherit'))),
      'CanEditType'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers', 'Inherit' => 'Inherit'))),
      'ToDo'              => new sfWidgetFormFilterInput(),
      'Version'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'Priority'          => new sfWidgetFormFilterInput(),
      'ParentID'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'ClassName'         => new sfValidatorChoice(array('required' => false, 'choices' => array('SiteTree' => 'SiteTree', 'Page' => 'Page', 'ErrorPage' => 'ErrorPage', 'RedirectorPage' => 'RedirectorPage', 'VirtualPage' => 'VirtualPage'))),
      'Created'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'LastEdited'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'URLSegment'        => new sfValidatorPass(array('required' => false)),
      'Title'             => new sfValidatorPass(array('required' => false)),
      'MenuTitle'         => new sfValidatorPass(array('required' => false)),
      'Content'           => new sfValidatorPass(array('required' => false)),
      'MetaTitle'         => new sfValidatorPass(array('required' => false)),
      'MetaDescription'   => new sfValidatorPass(array('required' => false)),
      'MetaKeywords'      => new sfValidatorPass(array('required' => false)),
      'ExtraMeta'         => new sfValidatorPass(array('required' => false)),
      'ShowInMenus'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ShowInSearch'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'HomepageForDomain' => new sfValidatorPass(array('required' => false)),
      'ProvideComments'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'Sort'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'HasBrokenFile'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'HasBrokenLink'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'Status'            => new sfValidatorPass(array('required' => false)),
      'ReportClass'       => new sfValidatorPass(array('required' => false)),
      'CanViewType'       => new sfValidatorChoice(array('required' => false, 'choices' => array('Anyone' => 'Anyone', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers', 'Inherit' => 'Inherit'))),
      'CanEditType'       => new sfValidatorChoice(array('required' => false, 'choices' => array('LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers', 'Inherit' => 'Inherit'))),
      'ToDo'              => new sfValidatorPass(array('required' => false)),
      'Version'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'Priority'          => new sfValidatorPass(array('required' => false)),
      'ParentID'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('sitetree_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'sitetree';
  }

  public function getFields()
  {
    return array(
      'ID'                => 'Number',
      'ClassName'         => 'Enum',
      'Created'           => 'Date',
      'LastEdited'        => 'Date',
      'URLSegment'        => 'Text',
      'Title'             => 'Text',
      'MenuTitle'         => 'Text',
      'Content'           => 'Text',
      'MetaTitle'         => 'Text',
      'MetaDescription'   => 'Text',
      'MetaKeywords'      => 'Text',
      'ExtraMeta'         => 'Text',
      'ShowInMenus'       => 'Number',
      'ShowInSearch'      => 'Number',
      'HomepageForDomain' => 'Text',
      'ProvideComments'   => 'Number',
      'Sort'              => 'Number',
      'HasBrokenFile'     => 'Number',
      'HasBrokenLink'     => 'Number',
      'Status'            => 'Text',
      'ReportClass'       => 'Text',
      'CanViewType'       => 'Enum',
      'CanEditType'       => 'Enum',
      'ToDo'              => 'Text',
      'Version'           => 'Number',
      'Priority'          => 'Text',
      'ParentID'          => 'Number',
    );
  }
}
